package security.Roles;
import java.util.*;


public abstract class Group {
	
	public abstract Vector<Privilege> getGroupPrivileges();
	
	public abstract void delGroupPrivilege(Privilege p);
	
	public abstract void addGroupPrivilege(Privilege p);
	
	public abstract void setGroupPrivileges(Vector<Privilege> groupPrivileges);
	
	public abstract Vector<User> getGroupUsers();
	
	public abstract void addGroupUsers(User u);
	
	public abstract void delGroupUsers(User u);
	
	public abstract void setGroupUsers(Vector<User> groupUsers);
	
	public abstract String getGroupName();
	
	public abstract void setGroupName(String groupName);
	
	// STATIC METHODS
	// MUST BE OVERWRITTEN BY SUBCLASSES

	
	public static boolean addGroup(Group g) {		
		throwError();
		return false;
	}
	public static boolean saveGroup(Group g) {
		throwError();
		return false;
	}
	public static boolean delGroup(Group g) {
		throwError();
		return false;
	}
	public static Vector<Group> getGroups() {
		throwError();
		return null;
	}
	public static Group getGroupByName(String groupName) {
		throwError();
		return null;
	}	
	private static void throwError() {
		throw new RuntimeException("Error: use a subclass of Group to call this method");
	}	
}
